<template>
    <div>
        <el-form :model="Approval" ref="Approval_ref">
            <el-form-item label="结果" label-width="40px">
                <el-radio-group v-model="Approval.State">
                    <el-radio :label="1">同意</el-radio>
                    <el-radio :label="0">拒绝</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="评价" label-width="40px" prop="Comment">
                <el-input type="textarea" v-model="Approval.Comment"></el-input>
            </el-form-item>
            <el-row>
                <el-col align="center">
                    <el-button type="success" @click="Submit">确认</el-button>
                </el-col>
            </el-row>
        </el-form>
    </div>
</template>

<script>
    export default {
        name: "AuditComment",
        props: {
            ApprovalReceipt: {
                type: Function,
                required: false,
            },
            Approval: {
                type: Object,
                required: true,
            },
        },
        watch: {
            Approval: function (ids) {
                this.$refs['Approval_ref'].resetFields()
                this.Approval.State = 1;
                this.Approval.Comment = "";
            }
        },
        created() {
            this.Approval.State = 1;
            this.Approval.Comment = "";
        },
        methods: {
            async Submit() {
                await this.ApprovalReceipt()
                // this.Approval.State = 1;
                // this.Approval.Comment = "";
                // this.FormClose_event()
            },
            //清空表格
            FormClose_event() {
                this.$refs['Approval_ref'].resetFields()
            },
        }
    }
</script>

<style scoped>

</style>
